package org.gourpg.model.chat;

import com.google.common.base.MoreObjects;
import com.google.common.base.Objects;

import java.sql.Timestamp;


public class MessageReadedDetail {

    /**
     * 消息编号
     */
    private Long messageId;

    /**
     * 聊天人
     */
    private Integer readedPersonId;

    /**
     * 阅读时间
     */
    private Timestamp readedStartTime;

    public MessageReadedDetail() {
    }

    public MessageReadedDetail(Long messageId, Integer readedPersonId, Timestamp readedStartTime) {
        this.messageId = messageId;
        this.readedPersonId = readedPersonId;
        this.readedStartTime = readedStartTime;
    }

    @Override
    public String toString() {
        return MoreObjects.toStringHelper(this)
                .add("messageId", messageId)
                .add("readedPersonId", readedPersonId)
                .add("readedStartTime", readedStartTime)
                .toString();
    }

    @Override
    public boolean equals(Object o) {
        if (o == null || getClass() != o.getClass()) return false;
        MessageReadedDetail that = (MessageReadedDetail) o;
        return Objects.equal(getMessageId(), that.getMessageId()) && Objects.equal(getReadedPersonId(), that.getReadedPersonId()) && Objects.equal(getReadedStartTime(), that.getReadedStartTime());
    }

    @Override
    public int hashCode() {
        return Objects.hashCode(getMessageId(), getReadedPersonId(), getReadedStartTime());
    }

    public Long getMessageId() {
        return messageId;
    }

    public void setMessageId(Long messageId) {
        this.messageId = messageId;
    }

    public Integer getReadedPersonId() {
        return readedPersonId;
    }

    public void setReadedPersonId(Integer readedPersonId) {
        this.readedPersonId = readedPersonId;
    }

    public Timestamp getReadedStartTime() {
        return readedStartTime;
    }

    public void setReadedStartTime(Timestamp readedStartTime) {
        this.readedStartTime = readedStartTime;
    }
}
